//
//  BIDOptionItemView.m
//  cxgov
//
//  Created by mal on 16/3/6.
//  Copyright © 2016年 mal. All rights reserved.
//

#import "BIDOptionItemView.h"

@interface BIDOptionItemView()
{
    UIColor *_yellowColor;
}
@end

@implementation BIDOptionItemView
@synthesize optionText;
@synthesize bSelect;
@synthesize delegate;

- (void)awakeFromNib
{
    _yellowColor = RGBACOLOR(241.f, 131.f, 73.f, 1.f);
}

- (void)setOptionText:(NSString *)optionText1
{
    optionText = optionText1;
    _optionLabel.text = optionText1;
}

- (void)setStatus:(BOOL)bFlag
{
    bSelect = bFlag;
    NSString *strImgName = bFlag?@"radio_choose.png":@"radio_inchoose.png";
    [_imgView setImage:[UIImage imageNamed:strImgName]];
}

- (IBAction)btnTouchUpInsideHandler:(id)sender
{
    [self setStatus:YES];
    [self setBackgroundColor:[UIColor whiteColor]];
    [delegate selectOptionItemAt:self.tag];
}

- (IBAction)btnDownHandler:(id)sender
{
    [self setBackgroundColor:_yellowColor];
}

- (IBAction)btnUpHandler:(id)sender
{
    [self setBackgroundColor:[UIColor whiteColor]];
}

- (IBAction)btnTouchDragOutsideHandler:(id)sender
{
    [self setBackgroundColor:[UIColor whiteColor]];
}

@end
